#include "SDL/SDL.h"
#include "SDL/SDL_thread.h"
#include "texture.h"
#include <string>
#include <list>

using namespace std;

class Moveable {
 public:
	virtual int Move(float x1, float y1) = 0;
};

class StaticImage : public Moveable
{
public:
	StaticImage(float x, float y, float xsize, float ysize, string tex);
	~StaticImage();
	void Render();
	int Move(float x1, float y1);
private:
	float x, y;
	float xsize, ysize;
	string texture;
};

class StaticText : public Moveable
{
public:
	StaticText(float x, float y, float xsize, float ysize, string tex);
	~StaticText();
	void Render();
	int Move(float x1, float y1);
private:
	float x, y;
	float xsize, ysize;
	string text;
};

class Canvas
{
public:
	Canvas();
	~Canvas();
	void SizeText(string text, int* x, int* y);
	StaticImage* AddImage(float x, float y, float xsize, float ysize, string tex);
	StaticText* AddText(float x, float y, float xsize, float ysize, string tex);
	void DelImage(StaticImage* ident);
	void DelText(StaticText* ident);
	void SetSize(float x1, float y1, float x2, float y2);
	void Render();
	int Move(Moveable* ident, float x1, float y1);

private:
	list<StaticImage*> image_list;
	list<StaticText*> text_list;
	float minx, miny, maxx, maxy;
};

